package demo3;

public class Person implements Cloneable{
    String name;
    Money money;

    public Person(String name, Money money) {
        this.name = name;
        this.money = money;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person p = (Person) super.clone();
        p.money = (Money) money.clone();
        return p;
    }
}
